1. Field of the Invention
The present invention relates generally to message transfers over a SCSI bus between a SCSI target and a SCSI initiator, and more particularly to message transfers over a SCSI bus between a SCSI target and a SCSI initiator that pass through a SCSI expander.
2. Description of Related Art
As the performance of computer systems and computer networks has improved, the performance demands on buses in these systems and networks has steadily increased. In SCSI systems, as the SCSI data rates increased, the SCSI bus cabling became a significant source of signal distortion. With the higher SCSI data rates, attenuation of high frequency components of SCSI data signals, signal reflections along an individual line of a SCSI cable, skew of signal timings across multiple cable lines, and cross-talk of signals across multiple cable lines have constrained SCSI cable lengths. All of these effects distort SCSI signals making reliable detection of the SCSI signals increasingly more difficult.
A device, call a SCSI expander, was created to restore signal quality along a SCSI bus. Actually, the use of expander in the name of the device was a misnomer. Calling the device a SCSI repeater or a SCSI extender would have been more descriptive of the functionality of the device. A SCSI expander, as used herein, is a device that does not increase the total number of target SCSI devices on the SCSI bus, but does restore signal quality along the SCSI bus.
SCSI expanders were inserted at points along a SCSI bus between SCSI initiators and SCSI target devices to clean up signals on the SCSI bus. A SCSI expander received SCSI signals from a first expander port, and retransmitted the SCSI signals out a second expander port. The retransmitted SCSI signals had less distortion than the received SCSI signals thereby enabling longer total SCSI bus lengths.
The introduction of SCSI expanders permitted changes in the SCSI bus topology. A SCSI bus without SCSI expanders had a one-dimensional topology. However, as illustrated in FIG. 1, a SCSI bus 100 with SCSI expanders 110_1 to 110_3 has a two-dimensional topology.
A first dimension 150 of the two-dimensional topology was defined by SCSI expanders 110_1 to 110_3 that were connected in series. A first expander 110_1 had a first port connected to initiator 120 and a second port connected to a first port of expander 110_2. A second port of expander 110_2 was connected to a first port of expander 110_3.
A second dimension 160 of the two-dimensional topology was defined by multiple daisy chains of SCSI target devices. Specifically, SCSI target devices 111 and 112 were connected to the second port of expander 110_1. SCSI target devices 113 and 114 were connected to the second port of expander 110_2 and SCSI target devices 115 and 116 were connected to the second port of expander 110_3. While the total number of SCSI target devices that could be connected to initiator 120 was not increased by the use of SCSI expanders, other more complex two-dimensional topologies of initiators, SCSI target devices, expanders and SCSI bus segments could be constructed.
Since SCSI expanders 110_1 to 110_3 only restored signal quality along SCSI bus 100, the presence of expanders 110_1 to 110_3 on SCSI bus 100 was not known either to initiator 120, or to SCSI target devices 111 to 116. Initiator 120 and SCSI target devices 111 to 116 conducted transactions over SCSI bus 100 using the same protocol as when expanders were not present. SCSI expanders 110_1 to 110_3 simply transferred communications from one port to another, and did not directly communicate with either initiators or SCSI target devices.
According to one embodiment of the present invention, a SCSI expander includes a capability for selectively delaying, saving, and modifying messages transferred between a SCSI initiator, sometimes called an initiator, and a SCSI target device, sometimes called a target. This novel message snooping capability has several advantages. It allows the SCSI expander to accurately follow the many different message sequences that can occur in SCSI data transfer options negotiations. It allows the SCSI expander to save information with respect to the data transfer options context for each SCSI initiator and SCSI target device pair on the SCSI bus. Finally, it allows the SCSI expander to be used in heterogeneous SCSI systems, i.e., in SCSI systems where a SCSI initiator, a SCSI target, and the SCSI expander may support different SCSI characteristics, such as data transfer rates, or perhaps signal conditioning requirements.
In one embodiment, traffic on a SCSI bus that is passed between a first port and a second port of the SCSI expander is monitored for a pre-selected message, or any message in a set of pre-selected messages. The pre-selected messages include messages used to negotiate SCSI data transfer options between an initiator and a target.
When the SCSI expander detects one of the pre-selected messages, transfer of the message between the first and second ports is delayed. The pre-selected message is loaded into a buffer and when a predefined number of units of the pre-selected message, e.g., the complete pre-selected message, is in the buffer, a processor processes the message.
The processing can include simply saving for future use information in the delayed pre-selected message that characterizes the data transfer options. In one embodiment, the processing by the processor modifies the data transfer options so that the data transfer options negotiated between the SCSI initiator and the SCSI target are supported by the SCSI expander. After the processor completes processing the delayed pre-selected message, the pre-selected message is passed out of the expander.
In one embodiment, the pre-selected message is delayed by delaying transfer of only a last unit of the pre-selected message between the first and second ports. Herein, a message includes at least one unit, e.g., a byte, or a word, and may include a plurality of units.
In another embodiment, the complete message is delayed. In general, a portion of the message from a pre-selected unit of the message thru the last unit of the message is delayed. In the first mentioned embodiment, the pre-selected unit is the last unit and in the second mentioned embodiment, the pre-selected unit is the first unit. In yet another embodiment, the pre-selected unit is a unit between the first unit and the last unit of the pre-selected message. After processing, the portion of the pre-selected message that has not been transferred between the first and second ports is released.
Hence, a SCSI expander, in one embodiment of the present invention, includes a first port, a second port, and a message delay buffer coupled to the first port and to the second port. The SCSI expander also includes a message snooping status comprising a plurality of message status flags and a message-snooping logic circuit coupled to the message delay buffer and to the message snooping status. Upon detection of a pre-selected message being transferred between the first and second ports, the message-snooping logic circuit (i) asserts one of the plurality of message status flags, (ii) enables the message delay buffer to receive the selected message, and (iii) delays transfer of the pre-selected message between the first and second ports.
In one embodiment, one of the plurality of message status flags includes a message-delay status flag. The plurality of message status flags also includes a message-direction flag having a first state and a second state where the particular state of the message-direction flag indicates a direction of transfer of the message between the first and second ports. The plurality of message status flags further includes a message-received status flag having first and second states where the second state of the message-received status flag indicates the message delay buffer contains a predefined number of units, e.g., all of the units, of the pre-selected message. The plurality of message status flags still further includes a message-release flag having a first state and a second state where the second state of the message-release flag indicates that any un-transferred units of the pre-selected message contained in the message delay buffer can be transferred through the SCSI expander.
The SCSI expander also includes a sequencer coupled to the message snooping status and to the message delay buffer. Upon detecting the second state of the message-received status flag, the sequencer saves information contained in the message delay buffer as saved message information. This saved message information also includes the message-direction flag.
The SCSI expander further includes a data transfer option table stored in a memory coupled to the sequencer. The sequencer updates the data transfer option table using the saved message information upon determining that a SCSI data transfer option negotiation completed successfully.
In one embodiment, the SCSI expander includes a message unit modification circuit coupled to the message-snooping logic circuit and to the message delay buffer. The message unit modification circuit modifies a unit of the pre-selected message contained in the message delay buffer.
Hence, in one embodiment, the SCSI expander of the present invention monitors messages transferred between a first port and a second port of the SCSI expander for a message used for negotiating data transfer options over a SCSI bus. The SCSI expander delays transfer of the message between the first and second ports of the SCSI expander upon the monitoring messages detecting the message. In one embodiment, the monitoring is performed only during SCSI bus message phases.
The delaying transfer of the message includes asserting a message-delay status flag upon the monitoring messages detecting the message, and loading the message into a message delay buffer, or at least a pre-selected number of units of the message into the message delay buffer. A message-received status flag is asserted upon the message being loaded in the message delay buffer.
The SCSI expander saves information in the message after the message-received status flag is asserted and asserts a message-release flag after saving the information. Any portion of the message that has not been transferred through the SCSI expander is released from the message delay buffer after the message-release flag is asserted. In one embodiment, the any portion is the message. In another embodiment, the any portion is a last unit of the message. In still another embodiment, the any portion includes units in the message from a pre-selected unit of the message to a last unit of the message. The unit or units that are released may be released individually one after the one, in a group, or in sets of units with one set after the other being released.
In yet another embodiment of the present invention in a SCSI expander, a method includes:
detecting a message phase on a SCSI bus;
monitoring, upon detecting the message phase, messages transferred between a first port and a second port of the SCSI expander for a message used in negotiating data transfer options over the SCSI bus;
entering a message delay state upon the monitoring messages detecting the message;
determining whether a next unit of the message to be transferred between the first and second ports is a pre-selected unit;
transferring the next unit between the first and second ports and loading the next unit into a message delay buffer, upon determining the next unit of the message is not the pre-selected unit; and
loading the next unit into the message delay buffer and delaying transfer of the next unit and any subsequent units of the message between the first and second ports, upon determining the next unit of the message is the pre-selected unit.